<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/internal/UdpClient.cpp 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li><li class="navelem"><a class="el" href="dir_1865c4ce8b99f52bbeabfd52bfdd7cd3.html">internal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">UdpClient.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_udp_client_8cpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#   include &quot;<a class="code" href="_iocp_service_8h.html">IocpService.h</a>&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#elif defined(LINUX)</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#   include &quot;<a class="code" href="_epoll_service_8h.html">EpollService.h</a>&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_udp_socket_8h.html">UdpSocket.h</a>&quot;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_udp_client_8h.html">UdpClient.h</a>&quot;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;../SockException.h&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;../Timer.h&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;assert.h&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a91f0018425e1ecb4c03ad408164c3ea7">   14</a></span>&#160;<a class="code" href="class_c_udp_client.html#a91f0018425e1ecb4c03ad408164c3ea7">CUdpClient::CUdpClient</a>(<span class="keywordtype">bool</span> isWriteLog) :<a class="code" href="class_c_udp_base.html">CUdpBase</a>(isWriteLog)</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;{</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifdef WIN32</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> CIocpService(&amp;<a class="code" href="class_c_udp_client.html#a9497aeb014bc19986f70b27d1b2c11da">IoCompleteFunc</a>));</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#elif defined(LINUX)</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> <a class="code" href="class_c_epoll_service.html">CEpollService</a>(&amp;<a class="code" href="class_c_udp_client.html#a9497aeb014bc19986f70b27d1b2c11da">IoCompleteFunc</a>));</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="keywordflow">if</span> (isWriteLog)</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#aedf29d5a0b744177d997d156068545bf">SetWriteLog</a>(<span class="keyword">true</span>);</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;}</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a86254296f26f5768dd3c4b8017450a64">   25</a></span>&#160;<a class="code" href="class_c_udp_client.html#a86254296f26f5768dd3c4b8017450a64">CUdpClient::~CUdpClient</a>()</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;{</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;}</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#aebf05411c8a2938f71b20faa002fbe2a">   30</a></span>&#160;<a class="code" href="class_c_sock_error.html">CSockError</a> <a class="code" href="class_c_udp_client.html#aebf05411c8a2938f71b20faa002fbe2a">CUdpClient::Init</a>(<a class="code" href="class_c_socket.html">CSocket</a>&amp; sock, <span class="keywordtype">bool</span> isServer <span class="comment">/* = false */</span>)</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;{</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    }</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> ec;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    sock.<a class="code" href="class_c_socket.html#ad08fc2df680d1fd84035f5aada97dd3a">SetService</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keywordflow">if</span> (*sock.<a class="code" href="class_c_socket.html#abfcf493607b9c1b40db907d89731d4a9">GetSockPtr</a>() == <a class="code" href="tools_8h.html#a26769957ec1a2beaf223f33b66ee64ab">INVALID_SOCKET</a>) ec = sock.<a class="code" href="class_c_socket.html#af4c2b2c6e3696ba11c605ee6fead1736">Socket</a>(sock.<a class="code" href="class_c_socket.html#a8f9deafc91bedf6c25122fe98e8174d8">GetDomain</a>(), sock.<a class="code" href="class_c_socket.html#a4db9f0924d9173baa17ffef5bfeeaa48">GetSockType</a>(), sock.<a class="code" href="class_c_socket.html#a3258d90d4a7626508fc8c43e0893b020">GetProtocol</a>());</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="comment">// 若未绑定端口则绑定之，若未设置地址、端口则随机取之</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="keywordflow">if</span> (!ec)</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    {</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <a class="code" href="class_c_sock_addr.html">CSockAddr</a> local;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="_sock_tools_8cpp.html#a94adf0712e04454717a4327e9061bdf8">GetSockName</a>(sock, local))</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        {</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            local.<a class="code" href="class_c_sock_addr.html#ab7aaac6f7f95bf879555e9391acdd3d6">SetDomain</a>(sock.<a class="code" href="class_c_socket.html#a8f9deafc91bedf6c25122fe98e8174d8">GetDomain</a>());</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            local.<a class="code" href="class_c_sock_addr.html#a489b625ee03b203ea32a5e859a51f04e">SetAddr</a>(sock.<a class="code" href="class_c_socket.html#adc23006ccfd784a08cbfd2a9c0d3c85e">GetAddr</a>().c_str());</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            <span class="keywordflow">if</span> (sock.<a class="code" href="class_c_socket.html#a45ff8ef020da674c0e1dfd947d03f18a">GetPort</a>()) local.<a class="code" href="class_c_sock_addr.html#a74baec009cf9d113674cbc5e9e3a76af">SetPort</a>(sock.<a class="code" href="class_c_socket.html#a45ff8ef020da674c0e1dfd947d03f18a">GetPort</a>());</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;            <span class="keywordtype">int</span> nRet = bind(*(sock.<a class="code" href="class_c_socket.html#abfcf493607b9c1b40db907d89731d4a9">GetSockPtr</a>()), local.<a class="code" href="class_c_sock_addr.html#a3e1b96bc3fec0a660e04466e66e97a4b">GetSockAddr</a>(), local.<a class="code" href="class_c_sock_addr.html#aeecf85a21d35f8d2b7408700b3bca5df">GetSize</a>());</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            <span class="keywordflow">if</span> (nRet) {</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                ec.SetError(CSockError::SYS_ERROR);</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            }</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        }</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <span class="keywordflow">if</span> (!ec) ec = <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#afc1a07c4cf6e9aa6f2a00d157dfd9eed">Init</a>(sock, <span class="keyword">false</span>);</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    }</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordflow">return</span> ec;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;}</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#ac80cab21b298c0b99e810fd19e06a42b">   60</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#ac80cab21b298c0b99e810fd19e06a42b">CUdpClient::AsyncConnect</a>(<a class="code" href="class_c_udp_socket.html">CUdpSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker<span class="comment">/* = NullPtr*/</span>)</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;{</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    }</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#af9546027933d2fcfcdc31b9366308ec3">PostConnectEx</a>(sock, func, invoker);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;}</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a09c194e8776369953eb427572972df48">   70</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#a09c194e8776369953eb427572972df48">CUdpClient::AsyncRead</a>(<a class="code" href="class_c_udp_socket.html">CUdpSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker<span class="comment">/* = NullPtr*/</span>)</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;{</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a258367c891c1b3f4208c7b41e95b864d">DeliveryRecv</a>(sock, (<span class="keywordtype">char</span>*)buff.<a class="code" href="class_c_stream_iteator.html#a0099f615b4deffd3273c9c4d7cae4a91">cbegin</a>(), (<span class="keywordtype">char</span>*)buff.<a class="code" href="class_c_stream_iteator.html#abd398f0c306bb0d8090328abdf29580a">cend</a>(), <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>, func, invoker);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    }</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;}</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160; </div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#acbfb5c3d02d26c74940eb9c77a29fe48">   80</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#acbfb5c3d02d26c74940eb9c77a29fe48">CUdpClient::AsyncSend</a>(<a class="code" href="class_c_udp_socket.html">CUdpSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker<span class="comment">/* = NullPtr*/</span>)</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;{</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a61ce383d1dc8faf0f821237e4cc438cf">DeliveryWrite</a>(sock, (<span class="keywordtype">char</span>*)buff.<a class="code" href="class_c_stream_iteator.html#a0099f615b4deffd3273c9c4d7cae4a91">cbegin</a>(), buff.<a class="code" href="class_c_stream_iteator.html#abd398f0c306bb0d8090328abdf29580a">cend</a>(), <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>, func, invoker);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    }</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;}</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a8cb56c4554afb0fd36e69c60a1e04933">   90</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#a8cb56c4554afb0fd36e69c60a1e04933">CUdpClient::Post</a>(<span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker<span class="comment">/* = NullPtr*/</span>)</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;{</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    }</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a2b82286514aa89ecd2a7470047c4845e">Post</a>(func, invoker);</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;}</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a9d65087deb9bfea428ff3bb615ce9954">  100</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_c_udp_client.html#a9d65087deb9bfea428ff3bb615ce9954">CUdpClient::Run</a>()</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;{</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    }</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a56a9ae4bb89bd85e21ae5507e3c6b093">Run</a>();</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;}</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a23979cafab8a95298ec8c248e62c426c">  109</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_c_udp_client.html#a23979cafab8a95298ec8c248e62c426c">CUdpClient::Run_One</a>()</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;{</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a8eb92d255bda145631e1dc57e42d3dba">Run_One</a>();</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;}</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#aa018e3d31a656f08527d151120c27794">  118</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#aa018e3d31a656f08527d151120c27794">CUdpClient::NotifyStop</a>()</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;{</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a88ce9281be3952a469f8c3b6bf0f9d5b">NotifyStop</a>();</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;}</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#ae07f629e082ecacf27ff0c91fa808ea5">  123</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_c_udp_client.html#ae07f629e082ecacf27ff0c91fa808ea5">CUdpClient::IsStop</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a87b609526def283ffb20cc4b4c082473">IsStop</a>();</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;}</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#aa9ed7c2a6ef85dcbba25056ff6777363">  129</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#aa9ed7c2a6ef85dcbba25056ff6777363">CUdpClient::WaitServerStop</a>()</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;{</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a88ce9281be3952a469f8c3b6bf0f9d5b">NotifyStop</a>();</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#ae247b9ad53c577481a6a17713e6a0685">Shutdown</a>();</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;}</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#ab0da6a1f850abeb24aa3ef691a1dd8c1">  136</a></span>&#160;<a class="code" href="class_c_io_port_service.html">CIoPortService</a>* <a class="code" href="class_c_udp_client.html#ab0da6a1f850abeb24aa3ef691a1dd8c1">CUdpClient::GetIoPortService</a>()</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;{</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>();</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;}</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160; </div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#aada20aa84fdb5b7983b89fa4f18b63df">  141</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#aada20aa84fdb5b7983b89fa4f18b63df">CUdpClient::DelTimer</a>(<a class="code" href="class_c_timer_base.html">CTimerBase</a>&amp; timer)</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;{</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    }</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a6a56a2a5a014ee11d4696eac5096d198">DelTimer</a>(*timer.<a class="code" href="class_c_timer_base.html#a1ea13f83b73eb54062006d563a5c2f85">GetTimerInfo</a>());</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    }</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;}</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a81bcb7d38ad17b9bc6ee13677ab7e287">  151</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_c_udp_client.html#a81bcb7d38ad17b9bc6ee13677ab7e287">CUdpClient::UpdateTimer</a>(<a class="code" href="class_c_timer_base.html">CTimerBase</a>&amp; timer)</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;{</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    }</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        </div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#ac30315805f5476c9e5ff36f3fa542485">UpdateTimer</a>(*timer.<a class="code" href="class_c_timer_base.html#a1ea13f83b73eb54062006d563a5c2f85">GetTimerInfo</a>());</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;}</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a7fc951a885bc9d3aab6ecdf0d1aa9273">  160</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_udp_client.html#a7fc951a885bc9d3aab6ecdf0d1aa9273">CUdpClient::SetTimer</a>(<a class="code" href="class_c_timer_base.html">CTimerBase</a>&amp; timer)</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;{</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">IsInit</a>()) {</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="class_c_sock_exception.html">CSockException</a>(<a class="code" href="class_c_sock_error.html">CSockError</a>(<a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">CSockError::UNINIT</a>).GetErrorMsg().c_str());</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    }</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <a class="code" href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">_service</a>-&gt;<a class="code" href="class_c_io_port_service.html#a5ffa1d9379ae7595d2febd119f42a738">SetTimer</a>(*timer.<a class="code" href="class_c_timer_base.html#a1ea13f83b73eb54062006d563a5c2f85">GetTimerInfo</a>());</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    }</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;}</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="class_c_udp_client.html#a9497aeb014bc19986f70b27d1b2c11da">  170</a></span>&#160;<a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_udp_client.html#a9497aeb014bc19986f70b27d1b2c11da">CUdpClient::IoCompleteFunc</a>(<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* oved)</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;{</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> dwRet = 0;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a> handle;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    handle.<a class="code" href="class_shared_ptr.html#a4d01af086ba301328e14f279a7ab400a">Swap</a>(oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a2696e48028b12aa65b271ec208c5483c">handle</a>);</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keywordflow">if</span> (oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">sockStatus</a> == <a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a119db78cc4a987e673c0d3ebbfd2d623">SOCKETSTATUS::CONNECTED</a>)</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    {</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        dwRet = (*handle)(oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a29eca265ddf9e8858e7360a27004866b">sockError</a>, oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">invoker</a>);</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    }</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">sockStatus</a> == <a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a8e36da283b8c83b61bab630b9b858724">SOCKETSTATUS::RECVED</a>)</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    {</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        dwRet = (*handle)(oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">wsaPtr</a>.<a class="code" href="struct___w_s_a_b_u_f.html#a018f049fe75c6f822a1765f16fdcb1f6">buf</a>, oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a46009f6f99e2e4e9e648f51ad55927ef">dwRead</a>, oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a29eca265ddf9e8858e7360a27004866b">sockError</a>, oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">invoker</a>);</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    }</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">sockStatus</a> == <a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a52566ca153bf6bcb661b1e8e606d3b5b">SOCKETSTATUS::SENDED</a>)</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    {</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        dwRet = (*handle)(oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">wsaPtr</a>.<a class="code" href="struct___w_s_a_b_u_f.html#a018f049fe75c6f822a1765f16fdcb1f6">buf</a>, oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#ae3a09cbbd58ac06dfd92673e3e7130fd">dwWrite</a>, oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a29eca265ddf9e8858e7360a27004866b">sockError</a>, oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">invoker</a>);</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    }</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">sockStatus</a> == <a class="code" href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876acbc6a92d2f6de3cda399fb0de0ffdd98">SOCKETSTATUS::POST</a>)</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        dwRet = (*handle)(oved-&gt;<a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">invoker</a>);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    }</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        assert(dwRet);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    }</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160; </div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keywordflow">return</span> dwRet;</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;}</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160; </div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_udp_client_html_a17f6e1e30545661f67e6bc2628c884e9"><div class="ttname"><a href="class_c_udp_client.html#a17f6e1e30545661f67e6bc2628c884e9">CUdpClient::_service</a></div><div class="ttdeci">SharedPtr&lt; CIoPortService &gt; _service</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8h_source.html#l00103">UdpClient.h:103</a></div></div>
<div class="ttc" id="aclass_c_sock_addr_html_aeecf85a21d35f8d2b7408700b3bca5df"><div class="ttname"><a href="class_c_sock_addr.html#aeecf85a21d35f8d2b7408700b3bca5df">CSockAddr::GetSize</a></div><div class="ttdeci">size_t GetSize() const</div><div class="ttdoc">返回地址结构大小</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8cpp_source.html#l00368">SockTools.cpp:368</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a56a9ae4bb89bd85e21ae5507e3c6b093"><div class="ttname"><a href="class_c_io_port_service.html#a56a9ae4bb89bd85e21ae5507e3c6b093">CIoPortService::Run</a></div><div class="ttdeci">virtual bool Run()=0</div><div class="ttdoc">运行服务</div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a61ce383d1dc8faf0f821237e4cc438cf"><div class="ttname"><a href="class_c_io_port_service.html#a61ce383d1dc8faf0f821237e4cc438cf">CIoPortService::DeliveryWrite</a></div><div class="ttdeci">virtual void DeliveryWrite(CSocket &amp;sock, const char *first, const char *end, CSockAddr *addr, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)=0</div><div class="ttdoc">投递一个写请求</div></div>
<div class="ttc" id="aclass_c_udp_client_html_ae07f629e082ecacf27ff0c91fa808ea5"><div class="ttname"><a href="class_c_udp_client.html#ae07f629e082ecacf27ff0c91fa808ea5">CUdpClient::IsStop</a></div><div class="ttdeci">virtual bool IsStop() const</div><div class="ttdoc">服务是否停止</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00123">UdpClient.cpp:123</a></div></div>
<div class="ttc" id="aclass_c_sock_error_html"><div class="ttname"><a href="class_c_sock_error.html">CSockError</a></div><div class="ttdoc">套接字错误信息类</div><div class="ttdef"><b>Definition:</b> <a href="_sock_error_8h_source.html#l00013">SockError.h:13</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_a1ea13f83b73eb54062006d563a5c2f85"><div class="ttname"><a href="class_c_timer_base.html#a1ea13f83b73eb54062006d563a5c2f85">CTimerBase::GetTimerInfo</a></div><div class="ttdeci">TimeoutInfo * GetTimerInfo()</div><div class="ttdoc">获取底层时间信息</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00091">Timer.cpp:91</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_a86254296f26f5768dd3c4b8017450a64"><div class="ttname"><a href="class_c_udp_client.html#a86254296f26f5768dd3c4b8017450a64">CUdpClient::~CUdpClient</a></div><div class="ttdeci">virtual ~CUdpClient()</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00025">UdpClient.cpp:25</a></div></div>
<div class="ttc" id="atools_8h_html_a26769957ec1a2beaf223f33b66ee64ab"><div class="ttname"><a href="tools_8h.html#a26769957ec1a2beaf223f33b66ee64ab">INVALID_SOCKET</a></div><div class="ttdeci">#define INVALID_SOCKET</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00215">tools.h:215</a></div></div>
<div class="ttc" id="aclass_c_stream_iteator_html"><div class="ttname"><a href="class_c_stream_iteator.html">CStreamIteator</a></div><div class="ttdef"><b>Definition:</b> <a href="_stream_byte_8h_source.html#l00011">StreamByte.h:11</a></div></div>
<div class="ttc" id="anamespace_s_o_c_k_e_t_s_t_a_t_u_s_html_a960fa087f22eb32da3c7d0c805be7876a52566ca153bf6bcb661b1e8e606d3b5b"><div class="ttname"><a href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a52566ca153bf6bcb661b1e8e606d3b5b">SOCKETSTATUS::SENDED</a></div><div class="ttdoc">发送完成</div><div class="ttdef"><b>Definition:</b> <a href="_socket_def_8h_source.html#l00094">SocketDef.h:94</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a46009f6f99e2e4e9e648f51ad55927ef"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a46009f6f99e2e4e9e648f51ad55927ef">OVERLAPPED_EX::dwRead</a></div><div class="ttdeci">DWORD dwRead</div><div class="ttdoc">当前读取的字节数</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00070">SockData.h:70</a></div></div>
<div class="ttc" id="aclass_c_sock_addr_html_a489b625ee03b203ea32a5e859a51f04e"><div class="ttname"><a href="class_c_sock_addr.html#a489b625ee03b203ea32a5e859a51f04e">CSockAddr::SetAddr</a></div><div class="ttdeci">bool SetAddr(const char *addr)</div><div class="ttdoc">设置地址</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8cpp_source.html#l00247">SockTools.cpp:247</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_af9546027933d2fcfcdc31b9366308ec3"><div class="ttname"><a href="class_c_io_port_service.html#af9546027933d2fcfcdc31b9366308ec3">CIoPortService::PostConnectEx</a></div><div class="ttdeci">virtual void PostConnectEx(CSocket &amp;sock, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)=0</div><div class="ttdoc">投递一个连接请求</div></div>
<div class="ttc" id="aclass_c_udp_client_html_ac80cab21b298c0b99e810fd19e06a42b"><div class="ttname"><a href="class_c_udp_client.html#ac80cab21b298c0b99e810fd19e06a42b">CUdpClient::AsyncConnect</a></div><div class="ttdeci">virtual void AsyncConnect(CUdpSocket &amp;sock, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个连接请求</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00060">UdpClient.cpp:60</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr&lt; HandleBase &gt;</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0f15d2d3d2834b0667791f3abfd9e0d7"><div class="ttname"><a href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">SharedPtr::Get</a></div><div class="ttdeci">Ty * Get()</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00202">SharedPtr.h:202</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_a23979cafab8a95298ec8c248e62c426c"><div class="ttname"><a href="class_c_udp_client.html#a23979cafab8a95298ec8c248e62c426c">CUdpClient::Run_One</a></div><div class="ttdeci">virtual bool Run_One()</div><div class="ttdoc">运行一次服务</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00109">UdpClient.cpp:109</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a2696e48028b12aa65b271ec208c5483c"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a2696e48028b12aa65b271ec208c5483c">OVERLAPPED_EX::handle</a></div><div class="ttdeci">SharedPtr&lt; HandleBase &gt; handle</div><div class="ttdoc">用户完成回调函数</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00068">SockData.h:68</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_acbfb5c3d02d26c74940eb9c77a29fe48"><div class="ttname"><a href="class_c_udp_client.html#acbfb5c3d02d26c74940eb9c77a29fe48">CUdpClient::AsyncSend</a></div><div class="ttdeci">virtual void AsyncSend(CUdpSocket &amp;sock, const CStreamIteator &amp;buff, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个写请求</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00080">UdpClient.cpp:80</a></div></div>
<div class="ttc" id="aclass_c_socket_html_a4db9f0924d9173baa17ffef5bfeeaa48"><div class="ttname"><a href="class_c_socket.html#a4db9f0924d9173baa17ffef5bfeeaa48">CSocket::GetSockType</a></div><div class="ttdeci">virtual SOCKTYPE::SockType GetSockType() const</div><div class="ttdoc">获取套接字发送类型</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00203">Socket.cpp:203</a></div></div>
<div class="ttc" id="a_udp_socket_8h_html"><div class="ttname"><a href="_udp_socket_8h.html">UdpSocket.h</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_a91f0018425e1ecb4c03ad408164c3ea7"><div class="ttname"><a href="class_c_udp_client.html#a91f0018425e1ecb4c03ad408164c3ea7">CUdpClient::CUdpClient</a></div><div class="ttdeci">CUdpClient(bool isWriteLog)</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00014">UdpClient.cpp:14</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a8eb92d255bda145631e1dc57e42d3dba"><div class="ttname"><a href="class_c_io_port_service.html#a8eb92d255bda145631e1dc57e42d3dba">CIoPortService::Run_One</a></div><div class="ttdeci">virtual bool Run_One()=0</div><div class="ttdoc">运行一次服务</div></div>
<div class="ttc" id="aclass_c_sock_addr_html"><div class="ttname"><a href="class_c_sock_addr.html">CSockAddr</a></div><div class="ttdoc">协议地址结构体</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00043">SockTools.h:43</a></div></div>
<div class="ttc" id="aclass_c_socket_html_a45ff8ef020da674c0e1dfd947d03f18a"><div class="ttname"><a href="class_c_socket.html#a45ff8ef020da674c0e1dfd947d03f18a">CSocket::GetPort</a></div><div class="ttdeci">virtual DWORD GetPort() const</div><div class="ttdoc">获取绑定或连接的端口</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00221">Socket.cpp:221</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_af6cda33264504094d59752d5725eb8e6"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#af6cda33264504094d59752d5725eb8e6">OVERLAPPED_EX::invoker</a></div><div class="ttdeci">void * invoker</div><div class="ttdoc">用户数据</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00076">SockData.h:76</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a6a56a2a5a014ee11d4696eac5096d198"><div class="ttname"><a href="class_c_io_port_service.html#a6a56a2a5a014ee11d4696eac5096d198">CIoPortService::DelTimer</a></div><div class="ttdeci">virtual void DelTimer(TimerInfo &amp;tinfo)=0</div><div class="ttdoc">删除定时器</div></div>
<div class="ttc" id="a_sock_tools_8cpp_html_a94adf0712e04454717a4327e9061bdf8"><div class="ttname"><a href="_sock_tools_8cpp.html#a94adf0712e04454717a4327e9061bdf8">GetSockName</a></div><div class="ttdeci">CSockError GetSockName(const CSocket &amp;sock, CSockAddr &amp;addr)</div><div class="ttdoc">获取套接口本地名字</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8cpp_source.html#l00077">SockTools.cpp:77</a></div></div>
<div class="ttc" id="aclass_c_udp_socket_html"><div class="ttname"><a href="class_c_udp_socket.html">CUdpSocket</a></div><div class="ttdoc">udp套接口</div><div class="ttdef"><b>Definition:</b> <a href="_udp_socket_8h_source.html#l00010">UdpSocket.h:10</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a258367c891c1b3f4208c7b41e95b864d"><div class="ttname"><a href="class_c_io_port_service.html#a258367c891c1b3f4208c7b41e95b864d">CIoPortService::DeliveryRecv</a></div><div class="ttdeci">virtual void DeliveryRecv(CSocket &amp;sock, char *first, char *end, CSockAddr *addr, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)=0</div><div class="ttdoc">投递一个接收请求</div></div>
<div class="ttc" id="aclass_c_udp_client_html_a09c194e8776369953eb427572972df48"><div class="ttname"><a href="class_c_udp_client.html#a09c194e8776369953eb427572972df48">CUdpClient::AsyncRead</a></div><div class="ttdeci">virtual void AsyncRead(CUdpSocket &amp;sock, const CStreamIteator &amp;buff, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个接收请求</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00070">UdpClient.cpp:70</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_ac30315805f5476c9e5ff36f3fa542485"><div class="ttname"><a href="class_c_io_port_service.html#ac30315805f5476c9e5ff36f3fa542485">CIoPortService::UpdateTimer</a></div><div class="ttdeci">virtual bool UpdateTimer(TimerInfo &amp;tinfo)=0</div><div class="ttdoc">更新定时器</div></div>
<div class="ttc" id="aclass_c_udp_client_html_a7fc951a885bc9d3aab6ecdf0d1aa9273"><div class="ttname"><a href="class_c_udp_client.html#a7fc951a885bc9d3aab6ecdf0d1aa9273">CUdpClient::SetTimer</a></div><div class="ttdeci">virtual void SetTimer(CTimerBase &amp;timer)</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00160">UdpClient.cpp:160</a></div></div>
<div class="ttc" id="anamespace_s_o_c_k_e_t_s_t_a_t_u_s_html_a960fa087f22eb32da3c7d0c805be7876a8e36da283b8c83b61bab630b9b858724"><div class="ttname"><a href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a8e36da283b8c83b61bab630b9b858724">SOCKETSTATUS::RECVED</a></div><div class="ttdoc">接收完成</div><div class="ttdef"><b>Definition:</b> <a href="_socket_def_8h_source.html#l00098">SocketDef.h:98</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a4d01af086ba301328e14f279a7ab400a"><div class="ttname"><a href="class_shared_ptr.html#a4d01af086ba301328e14f279a7ab400a">SharedPtr::Swap</a></div><div class="ttdeci">void Swap(SharedPtr&lt; Ty &gt; &amp;ptr)</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00245">SharedPtr.h:245</a></div></div>
<div class="ttc" id="anamespace_s_o_c_k_e_t_s_t_a_t_u_s_html_a960fa087f22eb32da3c7d0c805be7876a119db78cc4a987e673c0d3ebbfd2d623"><div class="ttname"><a href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a119db78cc4a987e673c0d3ebbfd2d623">SOCKETSTATUS::CONNECTED</a></div><div class="ttdoc">连接完成</div><div class="ttdef"><b>Definition:</b> <a href="_socket_def_8h_source.html#l00089">SocketDef.h:89</a></div></div>
<div class="ttc" id="aclass_c_socket_html"><div class="ttname"><a href="class_c_socket.html">CSocket</a></div><div class="ttdoc">套接口类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8h_source.html#l00030">Socket.h:30</a></div></div>
<div class="ttc" id="aclass_c_epoll_service_html"><div class="ttname"><a href="class_c_epoll_service.html">CEpollService</a></div><div class="ttdef"><b>Definition:</b> <a href="_epoll_service_8h_source.html#l00023">EpollService.h:23</a></div></div>
<div class="ttc" id="a_iocp_service_8h_html"><div class="ttname"><a href="_iocp_service_8h.html">IocpService.h</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_ae3a09cbbd58ac06dfd92673e3e7130fd"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#ae3a09cbbd58ac06dfd92673e3e7130fd">OVERLAPPED_EX::dwWrite</a></div><div class="ttdeci">DWORD dwWrite</div><div class="ttdoc">当前写入的字节数</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00071">SockData.h:71</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a3da45429c23fe76e84378d5dcfd24daa"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a3da45429c23fe76e84378d5dcfd24daa">OVERLAPPED_EX::wsaPtr</a></div><div class="ttdeci">WSABUF wsaPtr</div><div class="ttdoc">发送或接受缓存区</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00072">SockData.h:72</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_a81bcb7d38ad17b9bc6ee13677ab7e287"><div class="ttname"><a href="class_c_udp_client.html#a81bcb7d38ad17b9bc6ee13677ab7e287">CUdpClient::UpdateTimer</a></div><div class="ttdeci">virtual bool UpdateTimer(CTimerBase &amp;timer)</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00151">UdpClient.cpp:151</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html"><div class="ttname"><a href="class_c_timer_base.html">CTimerBase</a></div><div class="ttdoc">定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8h_source.html#l00017">Timer.h:17</a></div></div>
<div class="ttc" id="aclass_c_socket_html_ad08fc2df680d1fd84035f5aada97dd3a"><div class="ttname"><a href="class_c_socket.html#ad08fc2df680d1fd84035f5aada97dd3a">CSocket::SetService</a></div><div class="ttdeci">virtual void SetService(CBasicService *service)</div><div class="ttdoc">关联相应的工作类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00047">Socket.cpp:47</a></div></div>
<div class="ttc" id="aclass_c_sock_addr_html_ab7aaac6f7f95bf879555e9391acdd3d6"><div class="ttname"><a href="class_c_sock_addr.html#ab7aaac6f7f95bf879555e9391acdd3d6">CSockAddr::SetDomain</a></div><div class="ttdeci">void SetDomain(SOCKFAMILY::SockFamily domain)</div><div class="ttdoc">设置协议族</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8cpp_source.html#l00209">SockTools.cpp:209</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="a_udp_client_8h_html"><div class="ttname"><a href="_udp_client_8h.html">UdpClient.h</a></div></div>
<div class="ttc" id="aclass_c_stream_iteator_html_abd398f0c306bb0d8090328abdf29580a"><div class="ttname"><a href="class_c_stream_iteator.html#abd398f0c306bb0d8090328abdf29580a">CStreamIteator::cend</a></div><div class="ttdeci">virtual const char * cend() const</div><div class="ttdoc">返回序列结束位置</div><div class="ttdef"><b>Definition:</b> <a href="_stream_byte_8cpp_source.html#l00026">StreamByte.cpp:26</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_a9497aeb014bc19986f70b27d1b2c11da"><div class="ttname"><a href="class_c_udp_client.html#a9497aeb014bc19986f70b27d1b2c11da">CUdpClient::IoCompleteFunc</a></div><div class="ttdeci">static DWORD IoCompleteFunc(OVERLAPPED_EX *oved)</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00170">UdpClient.cpp:170</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a></div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00063">SockData.h:63</a></div></div>
<div class="ttc" id="a_epoll_service_8h_html"><div class="ttname"><a href="_epoll_service_8h.html">EpollService.h</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_aedf29d5a0b744177d997d156068545bf"><div class="ttname"><a href="class_c_io_port_service.html#aedf29d5a0b744177d997d156068545bf">CIoPortService::SetWriteLog</a></div><div class="ttdeci">void SetWriteLog(bool bWriteLog)</div><div class="ttdoc">设置日志输出函数</div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00114">IoPortService.h:114</a></div></div>
<div class="ttc" id="aclass_c_sock_exception_html"><div class="ttname"><a href="class_c_sock_exception.html">CSockException</a></div><div class="ttdoc">sockeet操作异常类</div><div class="ttdef"><b>Definition:</b> <a href="_sock_exception_8h_source.html#l00012">SockException.h:12</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0b0a4c8396bf40f91994f729855c0a5a"><div class="ttname"><a href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">SharedPtr::Reset</a></div><div class="ttdeci">void Reset(Ty *p)</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00175">SharedPtr.h:175</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_aa9ed7c2a6ef85dcbba25056ff6777363"><div class="ttname"><a href="class_c_udp_client.html#aa9ed7c2a6ef85dcbba25056ff6777363">CUdpClient::WaitServerStop</a></div><div class="ttdeci">virtual void WaitServerStop()</div><div class="ttdoc">通知服务停止并等待</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00129">UdpClient.cpp:129</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a5ffa1d9379ae7595d2febd119f42a738"><div class="ttname"><a href="class_c_io_port_service.html#a5ffa1d9379ae7595d2febd119f42a738">CIoPortService::SetTimer</a></div><div class="ttdeci">virtual void SetTimer(TimerInfo &amp;tinfo)=0</div><div class="ttdoc">设置定时器</div></div>
<div class="ttc" id="anamespace_s_o_c_k_e_t_s_t_a_t_u_s_html_a960fa087f22eb32da3c7d0c805be7876acbc6a92d2f6de3cda399fb0de0ffdd98"><div class="ttname"><a href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876acbc6a92d2f6de3cda399fb0de0ffdd98">SOCKETSTATUS::POST</a></div><div class="ttdoc">用户请求</div><div class="ttdef"><b>Definition:</b> <a href="_socket_def_8h_source.html#l00105">SocketDef.h:105</a></div></div>
<div class="ttc" id="aclass_c_stream_iteator_html_a0099f615b4deffd3273c9c4d7cae4a91"><div class="ttname"><a href="class_c_stream_iteator.html#a0099f615b4deffd3273c9c4d7cae4a91">CStreamIteator::cbegin</a></div><div class="ttdeci">virtual const char * cbegin() const</div><div class="ttdoc">返回序列开始位置</div><div class="ttdef"><b>Definition:</b> <a href="_stream_byte_8cpp_source.html#l00021">StreamByte.cpp:21</a></div></div>
<div class="ttc" id="atools_8h_html_a798af1e30bc65f319c1a246cecf59e39"><div class="ttname"><a href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a></div><div class="ttdeci">unsigned int DWORD</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00134">tools.h:134</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html"><div class="ttname"><a href="class_c_io_port_service.html">CIoPortService</a></div><div class="ttdef"><b>Definition:</b> <a href="_io_port_service_8h_source.html#l00032">IoPortService.h:32</a></div></div>
<div class="ttc" id="aclass_c_socket_html_a8f9deafc91bedf6c25122fe98e8174d8"><div class="ttname"><a href="class_c_socket.html#a8f9deafc91bedf6c25122fe98e8174d8">CSocket::GetDomain</a></div><div class="ttdeci">virtual SOCKFAMILY::SockFamily GetDomain() const</div><div class="ttdoc">获取协议族</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00198">Socket.cpp:198</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_a9d65087deb9bfea428ff3bb615ce9954"><div class="ttname"><a href="class_c_udp_client.html#a9d65087deb9bfea428ff3bb615ce9954">CUdpClient::Run</a></div><div class="ttdeci">virtual bool Run()</div><div class="ttdoc">运行服务</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00100">UdpClient.cpp:100</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a87b609526def283ffb20cc4b4c082473"><div class="ttname"><a href="class_c_io_port_service.html#a87b609526def283ffb20cc4b4c082473">CIoPortService::IsStop</a></div><div class="ttdeci">virtual bool IsStop() const =0</div><div class="ttdoc">服务是否停止</div></div>
<div class="ttc" id="aclass_c_sock_addr_html_a74baec009cf9d113674cbc5e9e3a76af"><div class="ttname"><a href="class_c_sock_addr.html#a74baec009cf9d113674cbc5e9e3a76af">CSockAddr::SetPort</a></div><div class="ttdeci">bool SetPort(DWORD port)</div><div class="ttdoc">设置端口</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8cpp_source.html#l00278">SockTools.cpp:278</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_aebf05411c8a2938f71b20faa002fbe2a"><div class="ttname"><a href="class_c_udp_client.html#aebf05411c8a2938f71b20faa002fbe2a">CUdpClient::Init</a></div><div class="ttdeci">virtual CSockError Init(CSocket &amp;sock, bool isServer)</div><div class="ttdoc">将sock与服务类绑定，一个socket只能绑定一个udp服务类</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00030">UdpClient.cpp:30</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_aa018e3d31a656f08527d151120c27794"><div class="ttname"><a href="class_c_udp_client.html#aa018e3d31a656f08527d151120c27794">CUdpClient::NotifyStop</a></div><div class="ttdeci">virtual void NotifyStop()</div><div class="ttdoc">通知服务停止</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00118">UdpClient.cpp:118</a></div></div>
<div class="ttc" id="aclass_c_socket_html_abfcf493607b9c1b40db907d89731d4a9"><div class="ttname"><a href="class_c_socket.html#abfcf493607b9c1b40db907d89731d4a9">CSocket::GetSockPtr</a></div><div class="ttdeci">virtual SOCKET * GetSockPtr() const</div><div class="ttdoc">获取套接口句柄指针</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00161">Socket.cpp:161</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_ab0da6a1f850abeb24aa3ef691a1dd8c1"><div class="ttname"><a href="class_c_udp_client.html#ab0da6a1f850abeb24aa3ef691a1dd8c1">CUdpClient::GetIoPortService</a></div><div class="ttdeci">virtual CIoPortService * GetIoPortService()</div><div class="ttdoc">获取底层服务类</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00136">UdpClient.cpp:136</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_c_sock_addr_html_a3e1b96bc3fec0a660e04466e66e97a4b"><div class="ttname"><a href="class_c_sock_addr.html#a3e1b96bc3fec0a660e04466e66e97a4b">CSockAddr::GetSockAddr</a></div><div class="ttdeci">SOCKADDR * GetSockAddr() const</div><div class="ttdoc">返回原始地址结构指针</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8cpp_source.html#l00403">SockTools.cpp:403</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a4e27edba8096659e67f2f275eeeba984"><div class="ttname"><a href="class_c_io_port_service.html#a4e27edba8096659e67f2f275eeeba984">CIoPortService::IsInit</a></div><div class="ttdeci">virtual bool IsInit() const =0</div></div>
<div class="ttc" id="aclass_c_socket_html_adc23006ccfd784a08cbfd2a9c0d3c85e"><div class="ttname"><a href="class_c_socket.html#adc23006ccfd784a08cbfd2a9c0d3c85e">CSocket::GetAddr</a></div><div class="ttdeci">virtual std::string GetAddr() const</div><div class="ttdoc">获取连接或绑定的地址</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00213">Socket.cpp:213</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a614e5742d57e4905fdf46b8727486b5e"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a614e5742d57e4905fdf46b8727486b5e">OVERLAPPED_EX::sockStatus</a></div><div class="ttdeci">DWORD sockStatus</div><div class="ttdoc">套接口的状态</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00074">SockData.h:74</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_afc1a07c4cf6e9aa6f2a00d157dfd9eed"><div class="ttname"><a href="class_c_io_port_service.html#afc1a07c4cf6e9aa6f2a00d157dfd9eed">CIoPortService::Init</a></div><div class="ttdeci">virtual CSockError Init(CSocket &amp;sock, bool isServer=false)=0</div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a88ce9281be3952a469f8c3b6bf0f9d5b"><div class="ttname"><a href="class_c_io_port_service.html#a88ce9281be3952a469f8c3b6bf0f9d5b">CIoPortService::NotifyStop</a></div><div class="ttdeci">virtual void NotifyStop()=0</div><div class="ttdoc">通知停止服务</div></div>
<div class="ttc" id="aclass_c_socket_html_af4c2b2c6e3696ba11c605ee6fead1736"><div class="ttname"><a href="class_c_socket.html#af4c2b2c6e3696ba11c605ee6fead1736">CSocket::Socket</a></div><div class="ttdeci">virtual CSockError Socket(SOCKFAMILY::SockFamily domain=SOCKFAMILY::IPV4, SOCKTYPE::SockType type=SOCKTYPE::STREAM, SOCKPROTOCOL::SockProtocol protocol=SOCKPROTOCOL::TCP)</div><div class="ttdoc">初始化套接字</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00068">Socket.cpp:68</a></div></div>
<div class="ttc" id="aclass_c_socket_html_a3258d90d4a7626508fc8c43e0893b020"><div class="ttname"><a href="class_c_socket.html#a3258d90d4a7626508fc8c43e0893b020">CSocket::GetProtocol</a></div><div class="ttdeci">virtual SOCKPROTOCOL::SockProtocol GetProtocol() const</div><div class="ttdoc">获取协议类型</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8cpp_source.html#l00208">Socket.cpp:208</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html_a29eca265ddf9e8858e7360a27004866b"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html#a29eca265ddf9e8858e7360a27004866b">OVERLAPPED_EX::sockError</a></div><div class="ttdeci">CSockError sockError</div><div class="ttdoc">错误码</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00075">SockData.h:75</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_a2b82286514aa89ecd2a7470047c4845e"><div class="ttname"><a href="class_c_io_port_service.html#a2b82286514aa89ecd2a7470047c4845e">CIoPortService::Post</a></div><div class="ttdeci">virtual void Post(const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)=0</div><div class="ttdoc">投递一个中断请求</div></div>
<div class="ttc" id="astruct___w_s_a_b_u_f_html_a018f049fe75c6f822a1765f16fdcb1f6"><div class="ttname"><a href="struct___w_s_a_b_u_f.html#a018f049fe75c6f822a1765f16fdcb1f6">_WSABUF::buf</a></div><div class="ttdeci">CHAR * buf</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00022">SockData.h:22</a></div></div>
<div class="ttc" id="aclass_c_io_port_service_html_ae247b9ad53c577481a6a17713e6a0685"><div class="ttname"><a href="class_c_io_port_service.html#ae247b9ad53c577481a6a17713e6a0685">CIoPortService::Shutdown</a></div><div class="ttdeci">virtual int Shutdown()=0</div><div class="ttdoc">停止服务,该函数会等待所有的线程退出</div></div>
<div class="ttc" id="aclass_c_udp_base_html"><div class="ttname"><a href="class_c_udp_base.html">CUdpBase</a></div><div class="ttdef"><b>Definition:</b> <a href="_udp_base_8h_source.html#l00011">UdpBase.h:11</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_a8cb56c4554afb0fd36e69c60a1e04933"><div class="ttname"><a href="class_c_udp_client.html#a8cb56c4554afb0fd36e69c60a1e04933">CUdpClient::Post</a></div><div class="ttdeci">virtual void Post(const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个中断请求</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00090">UdpClient.cpp:90</a></div></div>
<div class="ttc" id="anamespace_s_o_c_k_e_t_s_t_a_t_u_s_html_a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959"><div class="ttname"><a href="namespace_s_o_c_k_e_t_s_t_a_t_u_s.html#a960fa087f22eb32da3c7d0c805be7876a5a76b20cc3c857f53d6e5e7e817c8959">SOCKETSTATUS::UNINIT</a></div><div class="ttdoc">未初始化</div><div class="ttdef"><b>Definition:</b> <a href="_socket_def_8h_source.html#l00087">SocketDef.h:87</a></div></div>
<div class="ttc" id="aclass_c_udp_client_html_aada20aa84fdb5b7983b89fa4f18b63df"><div class="ttname"><a href="class_c_udp_client.html#aada20aa84fdb5b7983b89fa4f18b63df">CUdpClient::DelTimer</a></div><div class="ttdeci">virtual void DelTimer(CTimerBase &amp;timer)</div><div class="ttdef"><b>Definition:</b> <a href="_udp_client_8cpp_source.html#l00141">UdpClient.cpp:141</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
